use uo; 
use cfgfile; 

include "include/client"; 
include "include/attributes"; 
include "include/skillPoints"; 
include "include/statMod"; 
include ":poisonwatcher:poisons"; 
include "include/canAccess"; 

var nuevoitem; 

program do_tasteid(who) 
  EraseObjProperty(who, "IsMeditating"); 
  EraseObjProperty(who, "HealTimer"); 
  SendSysMessage(who, "Elije algo para probar."); 
  var descripcion; 
  var the_item := Target(who); 
  var fallocritico:=RandomInt(10)+1; 
  var acfgfile := ReadConfigFile(":*:itemdesc"); 
  var theitem := acfgfile[the_item.objtype]; 
  if(!the_item) 
   SendSysMessage(who, "Cancelado."); 
   return; 
  elseif (!can_access(who, the_item)) 
   return; 
  elseif (the_item.movable == 0) 
   SendSysMessage(who, "No puedes probar eso."); 
   return; 
  endif 
   if (espocion(the_item))    
   if(CheckSkill(who, SKILLID_TASTEID, -1, CInt(GetEffectiveSkill(who, SKILLID_TASTEID)))) 
      SendSysMessage(who, "Parece que contiene " + theitem.composicion); 
      SendSysMessage(who, "Debe de ser una " + theitem.nombre); 
      DestroyItem(the_item); 
      CreateItemInBackpack(who, nuevoitem, 1); 
      return; 
   elseif (fallocritico<2) 
      SendSysMessage(who, "Al probarla, la pocion se resbala de tus dedos y parte de su contenido se desliza en tu boca"); 
      var vida:=GetHp(who); 
      case(the_item.objtype) 
         0x0dc01: HealDamage(who, (RandomInt(3)  + 1)); 
         0x0dc02: HealDamage(who, (RandomInt(6) + 2)); 
         0x0dc03: HealDamage(who, (RandomInt(9) + 3)); 
         0x0dc04: AddPoison(who, "defaultPoison", 30, who, 1); 
         0x0dc05: AddPoison(who, "defaultPoison", 30, who, 2); 
         0x0dc06: AddPoison(who, "defaultPoison", 30, who, 3); 
         0x0dc17: AddPoison(who, "defaultPoison", 30, who, 4); 
         0x0dc08: SendSysMessage(who, "El fuerte sabor de la ceniza sulfurosa te quema la garganta!"); 
            SetHp(who, vida-2); 
         0x0dc09: SendSysMessage(who, "El fuerte sabor de la ceniza sulfurosa te quema la garganta!"); 
            SetHp(who, vida-6); 
         0x0dc07: SendSysMessage(who, "El fuerte sabor de la ceniza sulfurosa te quema la garganta!"); 
            SetHp(who, vida-9); 
         0x0dc0c: DoTempMod(who, "dex", 10,  20); 
         0x0dc0d: DoTempMod(who, "dex", 20, 45); 
         0x0dc0e: var heal_amount := RandomDiceRoll("2d4+1"); 
                if((heal_amount + GetStamina(who)) > GetMaxStamina(who)) 
               heal_amount := GetMaxStamina(who) - GetStamina(who); 
            endif 
         0x0dc0f: var heal_amount := RandomDiceRoll("5d6 +6"); 
                if((heal_amount + GetStamina(who)) > GetMaxStamina(who)) 
               heal_amount := GetMaxStamina(who) - GetStamina(who); 
            endif 
         0x0dc11: DoTempMod(who, "str", 10,  20); 
         0x0dc12: DoTempMod(who, "str", 20, 45); 
         0x0dce6: who.setlightlevel(0, 180); 
         0x0dc14: CurePoison(who, 30, "defaultPoison", 1); 
         0x0dc15: CurePoison(who, 30, "defaultPoison", 2); 
         0x0dc16: CurePoison(who, 30, "defaultPoison", 3); 
      endcase 
      DestroyItem(the_item); 
      CreateItemInBackpack(who, nuevoitem, 1); 
      return; 
   else 
      SendSysMessage(who, "No consigues descubrir a que sabe"); 
      return; 
   endif 
   elseif ((theitem.Attribute == "Swords") || (theitem.Attribute == "Fencing") || (theitem.script == "eat")) 
   var veneno:=GetObjProperty(the_item, "poison_level"); 
   if(CheckSkill(who, SKILLID_TASTEID, -1, CInt(GetEffectiveSkill(who, SKILLID_TASTEID)))) 
      Case(veneno) 
         1: descripcion:="Esto contiene poca belladona"; 
         2: descripcion:="Esto contiene algo de belladona"; 
         3: descripcion:="Esto contiene mucha belladona"; 
         4: descripcion:="Esto contiene belladona letal"; 
         default: descripcion:="Esto no contiene nada de veneno"; 
      endcase 
      SendSysMessage(who, descripcion); 
      return; 
   elseif ((fallocritico<2) && (veneno!=0)) 
      SendSysMessage(who, "Al probarlo, has entrado en contacto con el veneno!"); 
       AddPoison(who, "defaultPoison", 30, who, veneno); 
      return; 
   else 
      SendSysMessage(who, "No consigues saber nada del objeto"); 
      return; 
   endif 
   else 
   SendSysMessage(who,"Resultas un tanto ridiculo probando eso"); 
   return; 
   endif 
   endprogram 

function espocion(the_item) 
   case(the_item.objtype) 
   0x0DC01: nuevoitem:=0x0F0E; return 1; 
   0x0DC02: nuevoitem:=0xff05; return 1; 
   0x0DC03: nuevoitem:=0xff06; return 1; 
   0x0dc04: nuevoitem:=0x00F0E; return 1; 
   0x0dc05: nuevoitem:=0xff08; return 1; 
   0x0dc06: nuevoitem:=0xff09; return 1; 
   0x0dc17: nuevoitem:=0xff0a; return 1; 
   0x0dc08: nuevoitem:=0x00F0E; return 1; 
   0x0dc09: nuevoitem:=0xff0c; return 1; 
   0x0dc07: nuevoitem:=0xff0d; return 1; 
   0x0dc0c: nuevoitem:=0x00F0E; return 1; 
   0x0dc0d: nuevoitem:=0xff0f; return 1; 
   0x0dc0e: nuevoitem:= 0x00f0e; return 1; 
   0x0dc0f: nuevoitem:= 0xff11; return 1; 
   0x0dc11: nuevoitem:=0x00f0e; return 1; 
   0x0dc12: nuevoitem:=0xff13; return 1; 
   0x0dce6: nuevoitem:=0x00f0e; return 1; 
   0x0dc14: nuevoitem:=0x00f0e; return 1; 
   0x0dc15: nuevoitem:=0xff16; return 1; 
   0x0dc16: nuevoitem:=0xff17; return 1; 
   default: return 0; 
   endcase 
endfunction 


edit) Nearly forgot... i modified this lines in poisonskills.src in order to let characters poison food: 
Code: 
if((theitem.Attribute == "Swords") || (theitem.Attribute == "Fencing")) 
turned into Code: 
if((theitem.Attribute == "Swords") || (theitem.Attribute == "Fencing") || (theitem.script == "eat")) 


Also i added an "if" condition here: 
Code: 
       if ((theitem.Attribute == "Swords") || (theitem.Attribute == "Fencing")) 
           var hitscripts := GetObjProperty(the_item, "OnHit"); 
           if(!hitscripts) 
             hitscripts := array; 
           endif 
           if(!hitscripts.exists(":combat:poisonHit")) 
             hitscripts.append(":combat:poisonHit"); 
             SetObjProperty(the_item, "OnHit", hitscripts); 
           endif 
        endif 
